<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMybankBillRecordBindTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('mybank_bill_record_bind', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('billRecordId')->default(0)->comment('账单记录 ID');
            $table->unsignedBigInteger('vostroBillId')->default(0)->comment('网商银行来账记录 ID');
            $table->string('batchNo',32)->default('')->comment('批次号');
            $table->string('batchInstanceId',64)->default('')->comment('批次实例号，由本次批次处理的id号');
            $table->string('acquireId',16)->default('')->comment('渠道编号');
            $table->string('merchantId', 32)->default('')->comment("网商的商户号");
            $table->tinyInteger("flagMark")->default(0)->comment("标记 0:待分账 1:分账完成 2:分账失败");
            $table->unsignedInteger('completeTime')->default(0)->comment('完成时间');
            $table->string('remark',255)->default('')->comment('备注');
            $table->unsignedInteger('updatedAt')->default(0)->comment('更新时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('更新人');
            $table->tinyInteger("isDeleted")->default(0)->comment("是否删除,0:未删除,1:已删除");

            $table->comment = '网商银行来账记录与外卖平台账单记录关联绑定';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('mybank_bill_record_bind');
    }
}
